/**
 * Creat by TanLei
 * Description:
 * User:86183
 * Date:2022-05-11
 * Time:17:45
 */
public class Demo12 {
    public static void main(String[] args) {
        Thread thread = new Thread(()->{
            for(int i=0;i<5;i++){
                System.out.println("hello thread");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        thread.start();
        System.out.println("thread 线程还未结束");
        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();

        }
        System.out.println("thread 线程已经结束");
    }
}
